$OpenBSD: patch-setup_build_environment_py,v 1.4 2014/07/08 09:55:16 sthen Exp $

- find headers from /usr/local/include

- add a horrible hack to locate qt private headers unpacked using
the 'BUILD_DEPENDS=x11/qt4:patch' target

if updating patches, watch out for WRKDIR subst in last chunk,
and don't allow an updated patch to change the python shebang line,
it's correct with "env" here (handled in infrastructure).

--- setup/build_environment.py.orig	Fri Jul  4 05:05:26 2014
+++ setup/build_environment.py	Tue Jul  8 10:38:06 2014
@@ -7,11 +7,12 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.n
 __docformat__ = 'restructuredtext en'
 
 import os, socket, struct, subprocess, glob
+from distutils import sysconfig
 from distutils.spawn import find_executable
 
 from PyQt4 import pyqtconfig
 
-from setup import isosx, iswindows, is64bit
+from setup import isosx, iswindows, is64bit, isopenbsd
 is64bit
 
 OSX_SDK = '/Developer/SDKs/MacOSX10.5.sdk'
@@ -164,6 +165,12 @@ else:
     ft_lib_dirs = pkgconfig_lib_dirs('freetype2', 'FT_LIB_DIR', '/usr/lib')
     ft_libs = pkgconfig_libs('freetype2', '', '')
 
+if isopenbsd:
+    sw_inc_dir = os.path.join(sysconfig.PREFIX, 'include')
+    icu_inc_dirs = [sw_inc_dir]
+    chmlib_inc_dirs = [sw_inc_dir]
+    bq = glob.glob('${WRKDIR}/x11/qt4/qt-*/include')[-1]
+    qt_private_inc = ['%s/%s'%(bq, m) for m in ('QtGui', 'QtCore')]
 
 magick_error = None
 if not magick_inc_dirs or not os.path.exists(os.path.join(magick_inc_dirs[0],
